/**
 * 
 */
package org.swing.table.filter;

import java.awt.Component;

import javax.swing.DefaultCellEditor;
import javax.swing.JTable;
import javax.swing.JTextField;

import org.swing.table.imp.InlineFilterEditorComponentProvider;

/**
 * @author lqnhu
 *
 */
@SuppressWarnings("serial")
public class InlineFilterHeaderCellEditor extends DefaultCellEditor {
	private final InlineFilterEditorComponentProvider panelProvider;

	public InlineFilterHeaderCellEditor(
			InlineFilterEditorComponentProvider panelProvider) {
		super(new JTextField());
		this.panelProvider = panelProvider;
		this.setClickCountToStart(1);
	}

	public Component getTableCellEditorComponent(JTable table, Object value,
			boolean isSelected, int row, int column) {
		return this.getTableCellEditorComponent(column);
	}

	public Component getTableCellEditorComponent(int column) {
		return this.panelProvider.getInlineFilterEditPanel(column);
	}
}
